<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'testPrint.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	<style media=print>  
.Noprint{display:none;}  
.PageNext{page-break-after: always;}  
</style>
			<script language="javascript">  
			function pageSetup()//响应“页面设置”
			{
			document.all.WebBrowser.ExecWB(8,1);
			}
			function printPreview()//响应“打印预览”
			{
			this.crlPanel.style.display="none";
			document.all.WebBrowser.ExecWB(7,1);
			this.crlPanel.style.display="block";
			}
			function printOut()//响应“打印”
			{
			this.crlPanel.style.display="none";
			document.all.WebBrowser.ExecWB(6,1);
			this.crlPanel.style.display="block";
			}
			</script>
  </head>
  
  
  <body>
   <OBJECT id=WebBrowser classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height=0 width=0 VIEWASTEXT></OBJECT>
<div align="center" id="crlPanel">
<input type="button" name="btn1" value="页面设置" onClick="pageSetup()">&nbsp;
<input type="button" name="btn2" value="打印预览" onClick="printPreview()">&nbsp;
<input type="button" name="btn3" value="打印" onClick="printOut()">&nbsp;
</div>
这是第一页的内容
<div class="PageNext"></div>
这是第二页的内容
<div class="PageNext"></div>
这是第三页的内容

  </body>
</html>
